import request from '@/common/http/httpload.js'
	
	export default{
		login(data){	
			return request.post("user/login",data);
		},
		addunit(data){
			return request.post("unit/insert",data);
		},
		queryunit(){
			let user=uni.getStorageSync('user')
			var userName=user.unitId
			return request.get(`/unit/query/${userName}`)
		},
		queryRecord(){
			return request.get('/classify/getAll')
		},
		queryRecordList(){
		let id=	uni.getStorageSync('id')
			return request.get(`/classify/recordId/${id}`)
		},
		upload(data){
			return request.post('/upload',data)
		},
		// 修改
		updateUnit(data){
			return request.post('/unit/update',data)
		},
		delrecord(data){
			let RecordId=uni.getStorageSync('ids')
			return request.post(`/record/delete/${RecordId}`)
		},
		addrecord(data){
			return request.post('/record/insertRecord',data)
		},
		// put请求
		putData(data){
			// 传入的data对象  {ip:'xxxxxx'}; 
			//put方法大部分会以拼接地址的形式使用 如:request.put("/test/getInfo.php?id="+4)
			return request.put("/ip/getIpInfo.php",data);
		},
		// delete请求
		deleteData(data){
			// 传入的data对象  {ip:'xxxxxx'}; 
			//delete方法大部分会以拼接地址的形式使用 如:request.delete("/test/getInfo.php?id="+4)
			return request.delete("/ip/getIpInfo.php",data);
		}
	} 
